#include<stdio.h>
#include<math.h>
int main(void)

{
  int n,i,j,count=0;
  scanf("%d",&n);
  int flag=1;

  for(i=2;i<=n;i++)
  {
    for(j=2;j<=sqrt(i);j++)
   {
      if(i%j == 0)
      {
         flag = 0;
         break;
      }
       else flag = 1;
   }
     if(flag == 1)
    {
      printf("% d\n",i);
      count++;
    }
  }

  printf("%d",count);
}
